With EUDC, you can automatically create BBDB records (see BBDB) from records you get from a directory server. You do this by moving point to the appropriate record in a query result display buffer and invoking the command M-x eudc-insert-record-at-point-into-bbdb with the keyboard binding b1, or with the menu. EUDC cannot update an existing BBDB record and will signal an error if you try to insert a record matching an existing one.
It is also possible to export to BBDB the whole batch of records contained in the directory query result with the command M-x eudc-batch-export-records-to-bbdb.
Because directory systems may not enforce a strict record format, local server installations may use different attribute names and have different ways to organize the information. Furthermore BBDB has its own record structure. For these reasons converting a record from its external directory format to the BBDB format is a highly customizable process.
The value of this variable should be a symbol naming an alist defining a mapping between BBDB field names onto directory attribute names records. This is a protocol-local variable and is initialized upon protocol switch (see Server/Protocol Locals). The alist is made of cells of the form
(bbdb-field.spec-or-list). bbdb-field is the name of a field that must be defined in your BBDB environment (standard field names arename,company,net,phone,addressandnotes). spec-or-list is either a single mapping specification or a list of mapping specifications. Lists of mapping specifications are valid for thephoneandaddressBBDB fields only. specs are actually s-expressions which are evaluated as follows:
- a string
- evaluates to itself
- a symbol
- evaluates to the symbol value. Symbols corresponding to directory attribute names present in the record evaluate to the value of the field in the record
- a form
- is evaluated as a function. The argument list may contain attribute names which evaluate to the corresponding values in the record. The form evaluation should return something appropriate for the particular bbdb-field (see
bbdb-create-internal).eudc-bbdbify-phoneandeudc-bbdbify-addressare provided as convenience functions to parse phones and addresses.
The default value of the PH-specific value of that variable is
eudc-ph-bbdb-conversion-alist:
((name . name)
(net . email)
(address . (eudc-bbdbify-address address "Address"))
(phone . ((eudc-bbdbify-phone phone "Phone")
(eudc-bbdbify-phone office_phone "Office Phone"))))
This means that:
name field of the BBDB record gets its
value from the name attribute of the directory
recordnet field of the BBDB record gets its
value from the email attribute of the directory
recordaddress field of the BBDB record is
obtained by parsing the address attribute of the
directory record with the function
eudc-bbdbify-addressphone fields are created (when possible)
in the BBDB record. The first one has Phone for
location and its value is obtained by parsing the
phone attribute of the PH/QI record with the
function eudc-bbdbify-phone. The second one has
Office Phone for location its value is obtained by
parsing the office_phone attribute of the PH/QI
record with the function eudc-bbdbify-phone.This is a convenience function provided for use in
eudc-bbdb-conversion-alist. It parses phone into a vector compatible withbbdb-create-internal. phone is either a string supposedly containing a phone number or a list of such strings which are concatenated. location is used as the phone location for BBDB.
This is a convenience function provided for use in
eudc-bbdb-conversion-alist. It parses addr into a vector compatible withbbdb-create-internal. addr should be an address string of no more than four lines or a list of lines. The last line is searched for the zip code, city and state name. location is used as the phone location for BBDB.
Note that only a subset of the attributes you selected with
eudc-default-return-attributes and that are actually
displayed may actually be inserted as part of the newly created
BBDB record.
[1] This key binding does not actually call
eudc-insert-record-at-point-into-bbdb but uses
eudc-try-bbdb-insert instead.